package com.linln.modules.system.service;

import com.linln.modules.system.domain.SmsLog;
import com.linln.modules.system.repository.SmsLogRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SmsLogService {

    @Autowired
    private SmsLogRepository smsLogRepository;

    /**
     * 新增短信记录
     * @param orderNo
     * @param phone
     * @param sceneType   场景1 患者下陪护订单 2 订单开始服务 3 订单费用不足 4 订单状态变更
     * @param receiveType  接收类型 1 陪护公司管理员 2 陪护员 3 患者
     * @param receiveId
     * @param content
     * @param results
     */
    public void insert(String orderNo,String phone,int sceneType,int receiveType,long receiveId,String content,String results){
        SmsLog smsLog = new SmsLog();
        smsLog.setOrderNo(orderNo);
        smsLog.setPhone(phone);
        smsLog.setSceneType(sceneType);
        smsLog.setReceiveType(receiveType);
        smsLog.setReceiveId(receiveId);
        smsLog.setContent(content);
        smsLog.setResults(results);
        smsLogRepository.save(smsLog);
    }

}
